const express = require('express');
const querystring = require('querystring');
const bodyParser = require('body-parser');

var server = express();
server.listen(8080);

server.use(function (req,res,next) {
    var str = '';
    req.on('data',function (data) {
        str += data;
    })
    req.on('end',function () {
        req.body = querystring.parse(str);
        next();
    })
});

server.use('/',function (req,res,next) {
    //到这里的时候就已经包括了处理之后的body 了
    console.log(req.body)
})
